class Bg extends Laya.Sprite{
    constructor(){
        super();
        // this.loadImage('war/background.png')
        var bg1=new Laya.Sprite()
        bg1.loadImage('war/background.png')
        this.bg1=bg1
        var bg2=new Laya.Sprite()
        bg2.loadImage('war/background.png')
        this.bg2=bg2
        this.addChild(this.bg1)
        this.addChild(this.bg2)
        bg2.pos(0,-852)
        Laya.timer.frameLoop(1,this,this.onLoop);
        console.log(this)//Bg

    }

    onLoop(){
        this.y++;
        if(this.bg1.y+this.y>=852){
            this.bg1.y-=852*2
        }
        if(this.bg2.y+this.y>=852){
            this.bg2.y-=852*2
        }
    }

 



}
